Home | History | Annotate | Download | only in Tests_2007

Lines Matching full:code

24 <li><a href="#precode">Code Blocks</a></li>
31 <li><a href="#code">Code</a></li>
86 <p>The only restrictions are that block-level HTML elements -- e.g. <code>&lt;div&gt;</code>,
87 <code>&lt;table&gt;</code>, <code>&lt;pre&gt;</code>, <code>&lt;p&gt;</code>, etc. -- must be separated from surrounding
90 to add extra (unwanted) <code>&lt;p&gt;</code> tags around HTML block-level tags.</p>
94 <pre><code>This is a regular paragraph.
103 </code></pre>
106 HTML tags. E.g., you can't use Markdown-style <code>*emphasis*</code> inside an
109 <p>Span-level HTML tags -- e.g. <code>&lt;span&gt;</code>, <code>&lt;cite&gt;</code>, or <code>&lt;del&gt;</code> -- can be
112 you'd prefer to use HTML <code>&lt;a&gt;</code> or <code>&lt;img&gt;</code> tags instead of Markdown's
120 <p>In HTML, there are two characters that demand special treatment: <code>&lt;</code>
121 and <code>&amp;</code>. Left angle brackets are used to start tags; ampersands are
123 characters, you must escape them as entities, e.g. <code>&amp;lt;</code>, and
124 <code>&amp;amp;</code>.</p>
127 write about 'AT&amp;T', you need to write '<code>AT&amp;amp;T</code>'. You even need to
130 <pre><code>http://images.google.com/images?num=30&amp;q=larry+bird
131 </code></pre>
135 <pre><code>http://images.google.com/images?num=30&amp;amp;q=larry+bird
136 </code></pre>
138 <p>in your anchor tag <code>href</code> attribute. Needless to say, this is easy to
145 into <code>&amp;amp;</code>.</p>
149 <pre><code>&amp;copy;
150 </code></pre>
154 <pre><code>AT&amp;T
155 </code></pre>
159 <pre><code>AT&amp;amp;T
160 </code></pre>
166 <pre><code>4 &lt; 5
167 </code></pre>
171 <pre><code>4 &amp;lt; 5
172 </code></pre>
174 <p>However, inside Markdown code spans and blocks, angle brackets and
176 Markdown to write about HTML code. (As opposed to raw HTML, which is a
177 terrible format for writing about HTML syntax, because every single <code>&lt;</code>
178 and <code>&amp;</code> in your example code needs to be escaped.)</p>
195 character in a paragraph into a <code>&lt;br /&gt;</code> tag.</p>
197 <p>When you <em>do</em> want to insert a <code>&lt;br /&gt;</code> break tag using Markdown, you
200 <p>Yes, this takes a tad more effort to create a <code>&lt;br /&gt;</code>, but a simplistic
201 "every line break is a <code>&lt;br /&gt;</code>" rule wouldn't work for Markdown.
212 <pre><code>This is an H1
217 </code></pre>
219 <p>Any number of underlining <code>=</code>'s or <code>-</code>'s will work.</p>
224 <pre><code># This is an H1
229 </code></pre>
237 <pre><code># This is an H1 #
242 </code></pre>
246 <p>Markdown uses email-style <code>&gt;</code> characters for blockquoting. If you're
249 wrap the text and put a <code>&gt;</code> before every line:</p>
251 <pre><code>&gt; This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
257 </code></pre>
259 <p>Markdown allows you to be lazy and only put the <code>&gt;</code> before the first
262 <pre><code>&gt; This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
268 </code></pre>
271 adding additional levels of <code>&gt;</code>:</p>
273 <pre><code>&gt; This is the first level of quoting.
278 </code></pre>
281 and code blocks:</p>
283 <pre><code>&gt; ## This is a header.
288 &gt; Here's some example code:
291 </code></pre>
304 <pre><code>* Red
307 </code></pre>
311 <pre><code>+ Red
314 </code></pre>
318 <pre><code>- Red
321 </code></pre>
325 <pre><code>1. Bird
328 </code></pre>
334 <pre><code>&lt;ol&gt;
339 </code></pre>
343 <pre><code>1. Bird
346 </code></pre>
350 <pre><code>3. Bird
353 </code></pre>
370 <pre><code>* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
375 </code></pre>
379 <pre><code>* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
384 </code></pre>
387 items in <code>&lt;p&gt;</code> tags in the HTML output. For example, this input:</p>
389 <pre><code>* Bird
391 </code></pre>
395 <pre><code>&lt;ul&gt;
399 </code></pre>
403 <pre><code>* Bird
406 </code></pre>
410 <pre><code>&lt;ul&gt;
414 </code></pre>
420 <pre><code>1. This is a list item with two paragraphs. Lorem ipsum dolor
429 </code></pre>
435 <pre><code>* This is a list item with two paragraphs.
442 </code></pre>
444 <p>To put a blockquote within a list item, the blockquote's <code>&gt;</code>
447 <pre><code>* A list item with a blockquote:
451 </code></pre>
453 <p>To put a code block within a list item, the code block needs
456 <pre><code>* A list item with a code block:
458 &lt;code goes here&gt;
459 </code></pre>
464 <pre><code>1986. What a great season.
465 </code></pre>
470 <pre><code>1986\. What a great season.
471 </code></pre>
473 <h3 id="precode">Code Blocks</h3>
475 <p>Pre-formatted code blocks are used for writing about programming or
476 markup source code. Rather than forming normal paragraphs, the lines
477 of a code block are interpreted literally. Markdown wraps a code block
478 in both <code>&lt;pre&gt;</code> and <code>&lt;code&gt;</code> tags.</p>
480 <p>To produce a code block in Markdown, simply indent every line of the
483 <pre><code>This is a normal paragraph:
485 This is a code block.
486 </code></pre>
490 <pre><code>&lt;p&gt;This is a normal paragraph:&lt;/p&gt;
492 &lt;pre&gt;&lt;code&gt;This is a code block.
493 &lt;/code&gt;&lt;/pre&gt;
494 </code></pre>
497 line of the code block. For example, this:</p>
499 <pre><code>Here is an example of AppleScript:
504 </code></pre>
508 <pre><code>&lt;p&gt;Here is an example of AppleScript:&lt;/p&gt;
510 &lt;pre&gt;&lt;code&gt;tell application "Foo"
513 &lt;/code&gt;&lt;/pre&gt;
514 </code></pre>
516 <p>A code block continues until it reaches a line that is not indented
519 <p>Within a code block, ampersands (<code>&amp;</code>) and angle brackets (<code>&lt;</code> and <code>&gt;</code>)
521 easy to include example HTML source code using Markdown -- just paste
525 <pre><code> &lt;div class="footer"&gt;
528 </code></pre>
532 <pre><code>&lt;pre&gt;&lt;code&gt;&amp;lt;div class="footer"&amp;gt;
535 &lt;/code&gt;&lt;/pre&gt;
536 </code></pre>
538 <p>Regular Markdown syntax is not processed within code blocks. E.g.,
539 asterisks are just literal asterisks within a code block. This means
544 <p>You can produce a horizontal rule tag (<code>&lt;hr /&gt;</code>) by placing three or
549 <pre><code>* * *
560 </code></pre>
577 <pre><code>This is [an example](http://example.com/ "Title") inline link.
580 </code></pre>
584 <pre><code>&lt;p&gt;This is &lt;a href="http://example.com/" title="Title"&gt;
589 </code></pre>
594 <pre><code>See my [About](/about/) page for details.
595 </code></pre>
600 <pre><code>This is [an example][id] reference-style link.
601 </code></pre>
605 <pre><code>This is [an example] [id] reference-style link.
606 </code></pre>
611 <pre><code>[id]: http://example.com/ "Optional Title Here"
612 </code></pre>
628 <pre><code>[id]: &lt;http://example.com/&gt; "Optional Title Here"
629 </code></pre>
634 <pre><code>[id]: http://example.com/longish/path/to/resource/here
636 </code></pre>
643 <pre><code>[link text][a]
645 </code></pre>
654 <pre><code>[Google][]
655 </code></pre>
659 <pre><code>[Google]: http://google.com/
660 </code></pre>
665 <pre><code>Visit [Daring Fireball][] for more information.
666 </code></pre>
670 <pre><code>[Daring Fireball]: http://daringfireball.net/
671 </code></pre>
680 <pre><code>I get 10 times more traffic from [Google] [1] than from
686 </code></pre>
690 <pre><code>I get 10 times more traffic from [Google][] than from
696 </code></pre>
700 <pre><code>&lt;p&gt;I get 10 times more traffic from &lt;a href="http://google.com/"
704 </code></pre>
709 <pre><code>I get 10 times more traffic from [Google](http://google.com/ "Google")
712 </code></pre>
730 <p>Markdown treats asterisks (<code>*</code>) and underscores (<code>_</code>) as indicators of
731 emphasis. Text wrapped with one <code>*</code> or <code>_</code> will be wrapped with an
732 HTML <code>&lt;em&gt;</code> tag; double <code>*</code>'s or <code>_</code>'s will be wrapped with an HTML
733 <code>&lt;strong&gt;</code> tag. E.g., this input:</p>
735 <pre><code>*single asterisks*
742 </code></pre>
746 <pre><code>&lt;em&gt;single asterisks&lt;/em&gt;
753 </code></pre>
760 <pre><code>un*fucking*believable
761 </code></pre>
763 <p>But if you surround an <code>*</code> or <code>_</code> with spaces, it'll be treated as a
770 <pre><code>\*this text is surrounded by literal asterisks\*
771 </code></pre>
773 <h3 id="code">Code</h3>
775 <p>To indicate a span of code, wrap it with backtick quotes (<code>`</code>).
776 Unlike a pre-formatted code block, a code span indicates code within a
779 <pre><code>Use the `printf()` function.
780 </code></pre>
784 <pre><code>&lt;p&gt;Use the &lt;code&gt;printf()&lt;/code&gt; function.&lt;/p&gt;
785 </code></pre>
787 <p>To include a literal backtick character within a code span, you can use
790 <pre><code>``There is a literal backtick (`) here.``
791 </code></pre>
795 <pre><code>&lt;p&gt;&lt;code&gt;There is a literal backtick (`) here.&lt;/code&gt;&lt;/p&gt;
796 </code></pre>
798 <p>The backtick delimiters surrounding a code span may include spaces --
800 literal backtick characters at the beginning or end of a code span:</p>
802 <pre><code>A single backtick in a code span: `` ` ``
804 A backtick-delimited string in a code span: `` `foo` ``
805 </code></pre>
809 <pre><code>&lt;p&gt;A single backtick in a code span: &lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
811 &lt;p&gt;A backtick-delimited string in a code span: &lt;code&gt;`foo`&lt;/code&gt;&lt;/p&gt;
812 </code></pre>
814 <p>With a code span, ampersands and angle brackets are encoded as HTML
818 <pre><code>Please don't use any `&lt;blink&gt;` tags.
819 </code></pre>
823 <pre><code>&lt;p&gt;Please don't use any &lt;code&gt;&amp;lt;blink&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;
824 </code></pre>
828 <pre><code>`&amp;#8212;` is the decimal-encoded equivalent of `&amp;mdash;`.
829 </code></pre>
833 <pre><code>&lt;p&gt;&lt;code&gt;&amp;amp;#8212;&lt;/code&gt; is the decimal-encoded
834 equivalent of &lt;code&gt;&amp;amp;mdash;&lt;/code&gt;.&lt;/p&gt;
835 </code></pre>
847 <pre><code>![Alt text](/path/to/img.jpg)
850 </code></pre>
855 <li>An exclamation mark: <code>!</code>;</li>
856 <li>followed by a set of square brackets, containing the <code>alt</code>
859 the image, and an optional <code>title</code> attribute enclosed in double
865 <pre><code>![Alt text][id]
866 </code></pre>
871 <pre><code>[id]: url/to/image "Optional title attribute"
872 </code></pre>
876 use regular HTML <code>&lt;img&gt;</code> tags.</p>
886 <pre><code>&lt;http://example.com/&gt;
887 </code></pre>
891 <pre><code>&lt;a href="http://example.com/"&gt;http://example.com/&lt;/a&gt;
892 </code></pre>
899 <pre><code>&lt;address@example.com&gt;
900 </code></pre>
904 <pre><code>&lt;a href="&amp;#x6D;&amp;#x61;i&amp;#x6C;&amp;#x74;&amp;#x6F;:&amp;#x61;&amp;#x64;&amp;#x64;&amp;#x72;&amp;#x65;
908 </code></pre>
922 literal asterisks (instead of an HTML <code>&lt;em&gt;</code> tag), you can backslashes
925 <pre><code>\*literal asterisks\*
926 </code></pre>
930 <pre><code>\ backslash
942 </code></pre>